﻿// Decompiled with JetBrains decompiler
// Type: MG_Cooler.MGWaterCoolerConfig
// Assembly: MG_Cooler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 7560BFF2-5E64-4596-AB14-3DB707CE39FE
// Assembly location: E:\docs\Klei\OxygenNotIncluded\mods\Steam\2573951847\MG_Cooler.dll

using TUNING;
using UnityEngine;

namespace MG_Cooler
{
  public class MGWaterCoolerConfig : LiquidHeaterConfig
  {
    public new const string ID = "MGWaterCooler";
    public static string Name = "MGWaterCooler";
    public static string ENDescription = "This Cools down the water";
    public static string ENEffect = "Uses a smidge of power to cool down the water";
    public static string CNDescription = "水冷";
    public static string CNEffect = "不配个水冷你都不好意思说你的电脑有CPU";

    public override BuildingDef CreateBuildingDef()
    {
      string id = "MGWaterCooler";
      int width = 4;
      int height = 1;
      string anim = "boiler_kanim";
      int hitpoints = 30;
      float construction_time = 30f;
      float[] tieR4 = BUILDINGS.CONSTRUCTION_MASS_KG.TIER4;
      string[] allMetals = MATERIALS.ALL_METALS;
      float melting_point = 3200f;
      BuildLocationRule build_location_rule = BuildLocationRule.Anywhere;
      EffectorValues none = NOISE_POLLUTION.NONE;
      BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, tieR4, allMetals, melting_point, build_location_rule, BUILDINGS.DECOR.PENALTY.TIER1, none);
      buildingDef.RequiresPowerInput = true;
      buildingDef.Floodable = false;
      buildingDef.EnergyConsumptionWhenActive = 120f;
      buildingDef.ExhaustKilowattsWhenActive = -5000f;
      buildingDef.SelfHeatKilowattsWhenActive = -32f;
      buildingDef.ViewMode = OverlayModes.Power.ID;
      buildingDef.AudioCategory = "SolidMetal";
      buildingDef.OverheatTemperature = 1273.15f;
      buildingDef.LogicInputPorts = LogicOperationalController.CreateSingleInputPortList(new CellOffset(1, 0));
      return buildingDef;
    }

    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
      go.AddOrGet<LoopingSounds>();
      MGSpaceCooler mgSpaceCooler = go.AddOrGet<MGSpaceCooler>();
      mgSpaceCooler.SetLiquidHeater();
      mgSpaceCooler.targetTemperature = 1600f;
      mgSpaceCooler.minimumCellMass = 0.0f;
      go.AddOrGet<MinimumOperatingTemperature>().minimumTemperature = 16f;
    }

    public override void DoPostConfigureComplete(GameObject go)
    {
      base.DoPostConfigureComplete(go);
      go.AddOrGet<HeaterLogicTemperatureSensor>();
    }
  }
}
